package pms.common.dao;

import java.io.IOException;
import java.sql.SQLException;
import org.springframework.jdbc.core.JdbcTemplate;
import pms.common.value.sgNewValue;
import org.springframework.jdbc.support.lob.LobHandler;

public  class NewSGDaoImpl implements NewSGDao{
	
	private JdbcTemplate jdbcTemplate;
	private sgNewValue sgnew=new sgNewValue();
	private LobHandler lobHandler;
	public LobHandler getLobHandler() {
		return lobHandler;
	}
	public void setLobHandler(LobHandler lobHandler) {
		this.lobHandler = lobHandler;
	}

	public void doInsert(final sgNewValue sgnew)throws 
	      SQLException, InstantiationException, IllegalAccessException,
          ClassNotFoundException, IOException{  
	String l_sqlText = "insert into TBL_ZH_LIST(PROJECTID,TEMA,TEST_LVL,TEST_PART,TESTER,TEST_DATE,ZH_STATUS,MEMO,ERROR_TEXT,LIMIT_DATE,QA_MEMO,MODIFY_PART,ZH_MODIFY,MEHOOD,REASON,REASONS,EDIT_DATE,QA_DEL_FLAG) values ('" + sgnew.getProjectId() + "','" + sgnew.getTema() + "','"+sgnew.getTest_lvl()+"','"+sgnew.getTest_part()+"',"+
	"'"+sgnew.getTester()+"','"+sgnew.getTest_date_y()+sgnew.getTest_date_m()+sgnew.getTest_date_d()+"',"+
	"'"+sgnew.getStatus()+"','"+sgnew.getMemo()+"','"+sgnew.getError_text()+"','"+sgnew.getLimit_date_y()+sgnew.getLimit_date_m()+sgnew.getLimit_date_d()+"',"+
	"'"+sgnew.getQa_memo()+"','','"+sgnew.getModify()+"','','"+sgnew.getReason()+"','','','0')";
	
	jdbcTemplate.update(l_sqlText);
	}	 

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}


	public sgNewValue getSgnew() {
		return sgnew;
	}
	public void setSgnew(sgNewValue sgnew) {
		this.sgnew = sgnew;
	}
}
